<extend name="Include:Layout"/>
<block name="title">首页</block>
<block name="style">
<link rel="stylesheet" href="/Public/Assets/player/plyr.css">
<style>

</style>
</block>

<block name="main">
	<div class="weui_tab">
		<div class="weui_tab_bd container weui-pull-to-refresh" id="container">
			<div class="weui-pull-to-refresh-layer">
			    <div class="pull-to-refresh-arrow"></div> <!-- 上下拉动的时候显示的箭头 -->
			    <div class="pull-to-refresh-preloader"></div> <!-- 正在刷新的菊花 -->
			    <div class="down">下拉刷新</div><!-- 下拉过程显示的文案 -->
			    <div class="up">释放刷新</div><!-- 下拉超过50px显示的文案 -->
			    <div class="refresh">正在刷新...</div><!-- 正在刷新时显示的文案 -->
			</div>
			<div class="weui_panel weui_panel_access">
		        <div class="weui_panel_hd">教学视频</div>
		        <div class="weui_panel_bd">
		            <a href="javascript:void(0);" data-id="1" class="weui_media_box weui_media_appmsg showvedio">
		                <div class="weui_media_hd">
		                    <img class="weui_media_appmsg_thumb" src="" alt="">
		                </div>
		                <div class="weui_media_bd">
		                    <h4 class="weui_media_title">标题一</h4>
		                    <p class="weui_media_desc">由各种物质组成的巨型球状天体，叫做星球。星球有一定的形状，有自己的运行轨道。</p>
		                </div>
		            </a>
		            <a href="javascript:void(0);" data-id="2" class="weui_media_box weui_media_appmsg showvedio">
		                <div class="weui_media_hd">
		                    <img class="weui_media_appmsg_thumb" src="" alt="">
		                </div>
		                <div class="weui_media_bd">
		                    <h4 class="weui_media_title">标题二</h4>
		                    <p class="weui_media_desc">由各种物质组成的巨型球状天体，叫做星球。星球有一定的形状，有自己的运行轨道。</p>
		                </div>
		            </a>
		        </div>
		        <a class="weui_panel_ft" href="javascript:void(0);">查看更多</a>
		    </div>
		    
		    
	    </div>
		
		<php>$curbar = 1;</php>
    	<include file="Include:navbar" />
    </div>
<div id="article_detail" class="weui-popup-container popup-bottom"  style="background:#fff;">
  	<div class="weui-popup-modal" style="height:100%;">
  		<div class="content">
  		</div>
  		<div style="padding:30px 15px;">
  			<a href="javascript:;" class="weui_btn weui_btn_plain_primary close-popup">关闭</a>
  		</div>
  	</div>
</div>
<script type="text/html" id="tpl_article_vedio">
	<div class="article">
	    <article class="weui_article">
	    	<h1 class="page_title">{{title}}</h1>
	        <p>{{summary}}</p>
	        <video poster="{{vediourl}}?vframe/jpg/offset/5" controls crossorigin>
                <source src="{{vediourl}}" type="video/mp4">
            </video>
	    </article>
	</div>
</script>    
<script type="text/html" id="tpl_kecheng">
	
</script>
<script type="text/html" id="tpl_fuwu">

</script>
<script type="text/html" id="tpl_my">

</script>
</block>

<block name="script">
<js href="/Public/Assets/player/plyr.js" />
<script>
$("#container").pullToRefresh();
$("#container").on("pull-to-refresh", function() {
	alert('这边执行刷新操作');
	$("#container").pullToRefreshDone();
});
$(function () {
	
	//查看视频
	$('.showvedio').click(function(){
		var $this = $(this);
		$.showLoading("正在加载...");
		$.get('/home/home/get_vedio_test/id/'+$this.attr('data-id'),function(ret){
			$.hideLoading();
			if(ret.status){
				$('#article_detail .weui-popup-modal .content').html('');
				var html = template("tpl_article_vedio",ret.data);
				$('#article_detail .weui-popup-modal .content').html(html);
				$("#article_detail").popup();
			}else{
				$.alert(ret.info);
			}
		});
	});
	
	$('.weui_tabbar_item').click(function(){
		var $this = $(this);
		if(!$this.hasClass('weui_bar_item_on')){
			$('.weui_bar_item_on').removeClass('weui_bar_item_on');
			$this.addClass('weui_bar_item_on');
		}
	});
	
   
});
</script>
</block>